﻿@model WebBanHang.ViewModel.ListSanPhamViewModel

@{
    ViewBag.Title = "Danh Sách Sản Phẩm";
}

@using (Html.BeginForm("Submit", "SanPham", FormMethod.Post, new { @class = "mainform", id = "mainForm" }))
{
    <table id="product-table" width="100%">
        <tr>
            <th class="table-header-check">
                <input type="checkbox" onclick="checkall('options-width', this)" name="check" />
            </th>
            <th class="table-header-repeat line-left"><a href="#">Tên Sản Phẩm</a></th>
            <th class="table-header-repeat line-left minwidth-1"><a href="#">Nhóm Sản Phẩm</a>	</th>
            <th class="table-header-repeat line-left minwidth-1"><a href="#">Nhà Cung Cấp</a></th>
            <th class="table-header-repeat line-left"><a href="#">Số Lượng</a></th>
            <th class="table-header-repeat line-left"><a href="#">Giá</a></th>
            @*     <th class="table-header-options line-left"><a href="">Thao Tác</a></th>*@
        </tr>

        @foreach (var item in Model.ListSanPham)
        {
            <tr>
                <td>
                    <input type="checkbox" name="intDeletedIds" value="@item.SanPhamId" class="options-width" />
                <td>
                    @Html.ActionLink(item.TenSanPham, "Edit", new { id = item.SanPhamId })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.NhomSanPhamId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.NhaCungCap)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SoLuong)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Gia)
                </td>
            </tr>
        }
    </table>        
    
    <!--  start actions-box ............................................... -->
    <div id="actions-box">
        <a href="@Url.Action("Create", "SanPham")" class="action-slider"></a>
        <div id="actions-box-slider">
            <a href="@Url.Action("Create", "SanPham")"  class="action-edit">Tạo Mới</a>
            <a class="action-delete" onclick="submitForm('mainForm')" id="">Xóa</a>
        </div>
        <div class="clear"></div>
    </div>
    <!-- end actions-box........... -->

    <!--  start paging..................................................... -->
    <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
        <tr>
            <td>
                <a href="@Url.Action("Index", "SanPham", new { currentPage = @Model.Paging.FirstPage })" class="page-far-left"></a>
                <a href="@Url.Action("Index", "SanPham", new { currentPage = @Model.Paging.PreviousPage })" class="page-left"></a>
                <div id="page-info">Page <strong>@Model.Paging.CurrentPage</strong> / @Model.Paging.TotalPage</div>
                <a href="@Url.Action("Index", "SanPham", new { currentPage = @Model.Paging.NextPage })" class="page-right"></a>
                <a href="@Url.Action("Index", "SanPham", new { currentPage = @Model.Paging.LastPage })" class="page-far-right"></a>
            </td>
        </tr>
    </table>
}
<!--  end paging................ -->
@section Scripts 
{
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/ui.core.js" type="text/javascript"></script>
    <script src="~/Scripts/ui.checkbox.js" type="text/javascript"></script>
    <script src="~/Scripts/jquery.bind.js" type="text/javascript"></script>
    <script src="~/Scripts/Admin/checkall.js" type="text/javascript"></script>
    <script src="~/Scripts/Admin/submitform.js" type="text/javascript"></script>
}
